<template>
	<view class="myAssets u-skeleton">
		<u-navbar title="我的资产" :background="{
			'backgroundColor':'#fff'
		}" :borderBottom="false" class="u-skeleton-rect"></u-navbar>
		<view class="item u-skeleton-rect" @click="$util.redirectTo('/pages/my/mySpecies')">
			<view class="left">
				<view class="title">我的{{$store.state.jb}}</view>
				<view class="num">{{info.giveaway}}</view>
			</view>
			<u-icon name="arrow-right" size="36"></u-icon>
		</view>
		<view class="item u-skeleton-rect" @click="$util.redirectTo('/pages/tidalcard/myCrystal')">
			<view class="left">
				<view class="title">我的水晶</view>
				<view class="num">{{info.balance}}</view>
			</view>
			<u-icon name="arrow-right" size="36"></u-icon>
		</view>
		<view class="item u-skeleton-rect" @click="$util.redirectTo('/pages/my/cardCabinet')">
			<view class="left">
				<view class="title">我的闪卡</view>
				<view class="num">{{info.flashcard}}</view>
			</view>
			<u-icon name="arrow-right" size="36"></u-icon>
		</view>
		<view class="item u-skeleton-rect" @click="$util.redirectTo('/pages/my/myMine')">
			<view class="left">
				<view class="title">我的开采</view>
				<view class="num"></view>
			</view>
			<u-icon name="arrow-right" size="36"></u-icon>
		</view>
		<u-skeleton :loading="loding" :animation="true" bgColor="#FFF"></u-skeleton>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				loding: true, //初始化骨架屏展示
				info:{}
			}
		},
		onShow() {
			this.getinfo();
			
		},
		methods: {
			//获取用户自己的信息
			getinfo() {
				this.$http.asyncSendrequest({
					url: '/profile/userInfo',
					success: res => {
						if(res.code == '0') {
							this.info = res.data;
							this.loding = false //初始化骨架屏展示
						}
					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.myAssets{
		min-height: 100vh;
		.item{
			margin: 30rpx;
			height: 200rpx;
			background: #fff;
			padding: 30rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-radius: 10rpx;
			.left{
				.title{
					font-size: 28rpx;
					margin-bottom: 20rpx;
				}
				.num{
					font-size: 54rpx;
					font-weight: bold;
				}
			}
		}
	}
</style>